home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / Feelin021015 / Examples / 00.e < prev    next >
Encoding:
Text File  |  2002-10-28  |  3.4 KB  |  121 lines

  1. OPT PREPROCESS
  2.  
  3. MODULE 'feelin','libraries/feelin','a4',
  4.        'intuition/intuition',
  5.        'graphics/rastport','graphics/gfxmacros'
  6.  
  7. PROC main()
  8.    DEF c,w,w2,font,myback[16]:STRING,t1,t2,b
  9.  
  10.    sys_SGlob()
  11.  
  12.    font := 'Garnet/16'
  13.    StringF(myback,'F:\h\0',{drawfunc})
  14.    t1 := 'Feelin : Active'
  15.    t2 := 'Feelin : Inactive'
  16.  
  17.    IF feelinbase := OpenLibrary('feelin.library',FV_VERSION)
  18.       c := ClientObject,
  19.          FA_Client_Title, 'Demo_00',
  20.  
  21.          Child, w := WindowObject,
  22.             FA_ID,            "MAIN",
  23.             FA_Back,          myback,
  24.             FA_ContextHelp,   '`c`bThree colored buttons`n\t`jIt is possible for `ueach`n gadget\nto have its very own `Sscolor scheme`Sn.\nAll you have to do is define\none of the `SsFA_Pen_Xxx`Sn attribute.`z',
  25.             FA_Window_Title,  t1,
  26.  
  27.             Child, HGroup,
  28.                Child, TextObject, FA_Font,font, FA_Back,'c:FF0000', FA_AltBack,'c:FF8080', FA_Text,'Red',   InputRelease, FA_ContextHelp,'Red color',   End,
  29.                Child, b := TextObject, FA_Font,font, FA_Back,'c:00FF00', FA_AltBack,'c:80FF80', FA_Text,'Green', InputToggle, FA_ContextHelp,'Green color', End,
  30.                Child, TextObject, FA_Font,font, FA_Back,'c:0000FF', FA_AltBack,'c:8080FF', FA_Text,'Blue',  InputRelease, FA_ContextHelp,'Blue color',  End,
  31.             End,
  32.          End,
  33.  
  34.          Child, w2 := WindowObject,
  35.             FA_ID,            "WIN2",
  36.             FA_Window_Title,  'Window 2',
  37.             FA_Back,          myback,
  38.  
  39.             Child, HGroup, FA_FixedHeight,TRUE,
  40.                Child, TextObject, FA_Font,font, FA_Back,'c:FF0000', FA_Text,'Lotan is', End,
  41.                Child, BalanceID("BAL1"),
  42.                Child, TextObject, FA_Font,font, FA_Back,'c:FF0000', FA_Text,'my lord', End,
  43.             End,
  44.          End,
  45.       End
  46.  
  47.       IF c
  48.          F_DoA(w,FM_Notify,[FA_Window_Active,TRUE,w,5,
  49.                             FM_Set,FA_Window_Title,t1,FA_NoNotify,TRUE])
  50.          F_DoA(w,FM_Notify,[FA_Window_Active,FALSE,w,5,
  51.                             FM_Set,FA_Window_Title,t2,FA_NoNotify,TRUE])
  52.          F_DoA(w,FM_Notify,[FA_Window_CloseRequest,TRUE, FV_Notify_Client, 2,FM_Client_ReturnID,FV_Client_Quit])
  53.          F_DoA(w2,FM_Notify,[FA_Window_CloseRequest,TRUE,b,3,FM_Set,FA_Selected,FALSE])
  54.          F_DoA(b,FM_Notify,[FA_Selected,FV_Notify_Always, w2,3,FM_Set,FA_Window_Open,FV_Notify_Value])
  55.          F_Set(w,FA_Window_Open,TRUE)
  56.  
  57.          F_DoA(c,FM_Client_Run,NIL)
  58.  
  59.          F_DisposeObj(c)
  60.       ENDIF
  61.  
  62.       CloseLibrary(feelinbase)
  63.    ENDIF
  64. ENDPROC
  65.  
  66. PROC drawfunc(render=A0:PTR TO feelinRender,region=A2:PTR TO feelinRect)
  67.    DEF x1,y1,x2,y2,x3,
  68.        rp:PTR TO rastport,pt,op,ap,bp
  69.  
  70.    sys_RGlob()
  71.  
  72.    pt := [%1111111100000000,
  73.           %0111111110000000,
  74.           %0011111111000000,
  75.           %0001111111100000,
  76.           %0000111111110000,
  77.           %0000011111111000,
  78.           %0000001111111100,
  79.           %0000000111111110,
  80.           %0000000011111111,
  81.           %1000000001111111,
  82.           %1100000000111111,
  83.           %1110000000011111,
  84.           %1111000000001111,
  85.           %1111100000000111,
  86.           %1111110000000011,
  87.           %1111111000000001]:INT
  88. /*
  89.    pt := [%1111111100000000,
  90.           %0111111110000000,
  91.           %0011111111000000,
  92.           %0001111111100000,
  93.           %0000111111110000,
  94.           %0000011111111000,
  95.           %0000001111111100,
  96.           %0000000111111110,
  97.           %0000000011111111,
  98.           %0000000111111110,
  99.           %0000001111111100,
  100.           %0000011111111000,
  101.           %0000111111110000,
  102.           %0001111111100000,
  103.           %0011111111000000,
  104.           %0111111110000000]:INT
  105. */
  106.    x1 := region.x1 ; x3 := region.x2 ; x2 := x3 - x1 / 3 + x1
  107.    y1 := region.y1 ; y2 := region.y2 ; rp := render.rport
  108.  
  109.    ap := render.pens[FV_Pen_Fill]
  110.    bp := render.pens[FV_Pen_HalfShadow]
  111.  
  112.    _APen(bp)
  113.    _Boxf(x1,y1,x2,y2)
  114.  
  115.    SetAfPt(rp,pt,4)
  116.    _APen(ap)
  117.    _BPen(bp)
  118.    _Boxf(x2+1,y1,x3,y2)
  119.    SetAfPt(rp,[-1,-1],0)
  120. ENDPROC
  121.